/**
 *
 * @author Kassio Kiarelly Soares de Oliveira <kassiokiarelly@gmail.com>
 */

package Visao;

import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;


public class MenuPrincipal extends javax.swing.JFrame {


    public MenuPrincipal() {
        initComponents();
        setLocationRelativeTo(null);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btGridHospede = new javax.swing.JButton();
        btNovoHospede = new javax.swing.JButton();
        btListaHoteis = new javax.swing.JButton();
        btNovoHotel = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        btListaReservas = new javax.swing.JButton();
        btAddQuarto = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Hotéis Hilton");

        btGridHospede.setText("Lista de Hospedes");
        btGridHospede.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGridHospedeActionPerformed(evt);
            }
        });

        btNovoHospede.setText("Novo Hospede");
        btNovoHospede.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNovoHospedeActionPerformed(evt);
            }
        });

        btListaHoteis.setText("Lista de Hotéis");
        btListaHoteis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btListaHoteisActionPerformed(evt);
            }
        });

        btNovoHotel.setText("Novo Hotel");
        btNovoHotel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNovoHotelActionPerformed(evt);
            }
        });

        jButton1.setText("Nova Reserva");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        btListaReservas.setLabel("Lista de Reservas");
        btListaReservas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btListaReservasActionPerformed(evt);
            }
        });

        btAddQuarto.setText("Adicionar Quarto");
        btAddQuarto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAddQuartoActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, btNovoHotel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, btNovoHospede))
                .add(26, 26, 26)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(btGridHospede, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                    .add(btAddQuarto, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 159, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(btListaHoteis, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                    .add(btListaReservas, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
                .add(228, 228, 228))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(187, Short.MAX_VALUE)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(layout.createSequentialGroup()
                        .add(btListaHoteis)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btAddQuarto)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btGridHospede)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btListaReservas))
                    .add(layout.createSequentialGroup()
                        .add(jButton1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(btNovoHotel)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(btNovoHospede)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btGridHospedeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGridHospedeActionPerformed
        GridHospede grid = new GridHospede();
        grid.setVisible(true);
    }//GEN-LAST:event_btGridHospedeActionPerformed

    private void btNovoHospedeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNovoHospedeActionPerformed
         java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FormHospede().setVisible(true);
            }
        });
    }//GEN-LAST:event_btNovoHospedeActionPerformed

    private void btNovoHotelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNovoHotelActionPerformed
         java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FormHotel().setVisible(true);
            }
        });
    }//GEN-LAST:event_btNovoHotelActionPerformed

    private void btListaHoteisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btListaHoteisActionPerformed
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new GridHotel().setVisible(true);
            }
        });
    }//GEN-LAST:event_btListaHoteisActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FormReserva().setVisible(true);
            }
        });
    }//GEN-LAST:event_jButton1ActionPerformed

    private void btListaReservasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btListaReservasActionPerformed
         java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                try {
                    new GridReservas().setVisible(true);
                } catch (RemoteException ex) {
                    Logger.getLogger(MenuPrincipal.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }//GEN-LAST:event_btListaReservasActionPerformed

    private void btAddQuartoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAddQuartoActionPerformed
         java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FormQuarto().setVisible(true);
            }
        });
    }//GEN-LAST:event_btAddQuartoActionPerformed




    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAddQuarto;
    private javax.swing.JButton btGridHospede;
    private javax.swing.JButton btListaHoteis;
    private javax.swing.JButton btListaReservas;
    private javax.swing.JButton btNovoHospede;
    private javax.swing.JButton btNovoHotel;
    private javax.swing.JButton jButton1;
    // End of variables declaration//GEN-END:variables

}
